Conversation
📝 WalkthroughWalkthroughThis PR introduces AI profile classification rendering by adding a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (4)
components/waves/utils/getOptimisticDrop.ts (1)
93-94: Consider a defensive fallback forclassificationconsistent withbuildPreviewDrop.
buildPreviewDropfalls back toApiProfileClassification.Pseudonymwhen missing, but here the value is passed through directly. If any stale/cachedconnectedProfilelacksclassificationat runtime (e.g., during rollout), the optimistic drop author would carryundefined, which violates theApiProfileMincontract and could break downstream consumers likeProfileNameWithAiMarker. Mirroring the preview builder's fallback would be safer.♻️ Suggested change
- classification: connectedProfile.classification, - sub_classification: connectedProfile.sub_classification, + classification: + connectedProfile.classification ?? ApiProfileClassification.Pseudonym, + sub_classification: connectedProfile.sub_classification ?? null,(Requires importing
ApiProfileClassification.)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@components/waves/utils/getOptimisticDrop.ts` around lines 93 - 94, getOptimisticDrop currently passes connectedProfile.classification through directly which can be undefined; update getOptimisticDrop to mirror buildPreviewDrop by importing ApiProfileClassification and defaulting classification to ApiProfileClassification.Pseudonym when connectedProfile.classification is falsy, so the optimistic drop (and its ApiProfileMin shape used by components like ProfileNameWithAiMarker) always has a valid classification value.components/common/profile/ProfileNameWithAiMarker.tsx (1)
15-24: Optional: consider mergingclassNamewith defaults instead of replacing.Currently, any caller passing
classNamelosesDEFAULT_CLASS_NAME(flex/gap), silently breaking marker layout. Either document this explicitly, or compose the classes (e.g., viaclsx) so consumers can augment rather than replace.♻️ Suggested refactor
-export default function ProfileNameWithAiMarker({ - classification, - children, - className = DEFAULT_CLASS_NAME, - markerClassName, -}: ProfileNameWithAiMarkerProps) { +export default function ProfileNameWithAiMarker({ + classification, + children, + className, + markerClassName, +}: ProfileNameWithAiMarkerProps) { const isAiProfile = classification === ApiProfileClassification.Ai; return ( - <span className={className}> + <span className={className ? `${DEFAULT_CLASS_NAME} ${className}` : DEFAULT_CLASS_NAME}>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@components/common/profile/ProfileNameWithAiMarker.tsx` around lines 15 - 24, ProfileNameWithAiMarker currently replaces DEFAULT_CLASS_NAME when a caller supplies className which breaks layout; update the component to merge DEFAULT_CLASS_NAME with the incoming className (e.g., via clsx or a simple `${DEFAULT_CLASS_NAME} ${className}` composition) when building the span's className, and similarly compose markerClassName with its default if present; modify the return span in ProfileNameWithAiMarker to use the composed class strings so callers can augment rather than replace the defaults (leave ApiProfileClassification.Ai, children and other logic unchanged).__tests__/components/waves/drops/DropMinimalIdentityRow.test.tsx (1)
65-74: Weak negative assertion for the robot emoji.
not.toHaveTextContent("🤖")on the tooltip wrapper only checks the mocked tooltip subtree. A stronger, more intent-revealing assertion would beexpect(screen.queryByText("🤖")).not.toBeInTheDocument();, matching the pattern used inProfileNameWithAiMarker.test.tsx.🔧 Suggested change
- expect(screen.getByRole("link", { name: "human" })).toBeInTheDocument(); - expect(screen.getByTestId("tooltip-wrapper")).not.toHaveTextContent("🤖"); + expect(screen.getByRole("link", { name: "human" })).toBeInTheDocument(); + expect(screen.queryByText("🤖")).not.toBeInTheDocument();🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@__tests__/components/waves/drops/DropMinimalIdentityRow.test.tsx` around lines 65 - 74, Replace the weak negative assertion on the tooltip subtree with a global DOM absence check: in the test that renders DropMinimalIdentityRow (the case using createDrop("human", "0xabc", ApiProfileClassification.Pseudonym)), remove expect(screen.getByTestId("tooltip-wrapper")).not.toHaveTextContent("🤖") and instead assert expect(screen.queryByText("🤖")).not.toBeInTheDocument(); so the test verifies the robot emoji is not present anywhere in the rendered output.__tests__/components/waves/drops/WaveDropHeader.test.tsx (1)
95-108: Same weak negative assertion as inDropMinimalIdentityRow.test.tsx.Prefer
expect(screen.queryByText("🤖")).not.toBeInTheDocument();overnot.toHaveTextContent("🤖")scoped to the tooltip wrapper, for consistency withProfileNameWithAiMarker.test.tsxand a stronger assertion.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@__tests__/components/waves/drops/WaveDropHeader.test.tsx` around lines 95 - 108, Replace the weak negative assertion in the "does not render a robot emoji for non-AI profiles" test in WaveDropHeader.test.tsx: instead of asserting the tooltip wrapper does not have text content "🤖" via getByTestId("tooltip-wrapper"), use a global query for the emoji and assert it is not present (expect(screen.queryByText("🤖")).not.toBeInTheDocument()), matching the stronger pattern used in ProfileNameWithAiMarker.test.tsx; update the assertion in the test for WaveDropHeader accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@components/user/user-page-header/name/UserPageHeaderName.tsx`:
- Around line 57-64: The inline <span> inside ProfileNameWithAiMarker can
misalign with the smaller marker; restore the original block-level semantics or
enforce vertical centering: replace the inner <span> with the previous <p> that
carried the typography (ensuring no default margins) or add alignment utility
classes on ProfileNameWithAiMarker (e.g., make it an inline-flex/flex container
with items-center) so the displayName text and the 🤖 marker vertically align
across breakpoints; update the JSX where ProfileNameWithAiMarker is used and
adjust classes (tw-*) accordingly.
In `@components/waves/drops/DropAuthorBadges.tsx`:
- Around line 42-43: The change made `classification` and `sub_classification`
required breaks callers (e.g., the test's baseProfile) and toApiProfileMin
passes them through without fallbacks; revert this by making those fields
optional on the ApiProfile type (or change DropAuthorBadges props to accept
optional fields) and update toApiProfileMin to provide safe defaults (e.g.,
profile.classification ?? <default> and profile.sub_classification ?? null),
and/or update the test fixture baseProfile in DropAuthorBadges.test.tsx to
include valid values for classification and sub_classification so all callers
compile under strict TypeScript.
In `@openapi.yaml`:
- Around line 10500-10512: ApiPaymentDetails currently forces
designated_payee_name to be a non-null string; update the ApiPaymentDetails
schema so designated_payee_name can be null when has_designated_payee is false
by making the designated_payee_name property nullable (OpenAPI 3.0: add
nullable: true) or permitting ["string","null"] (OpenAPI 3.1), keeping the
property name as designated_payee_name and leaving has_designated_payee as-is;
ensure schema validation accepts null payloads for designated_payee_name.
---
Nitpick comments:
In `@__tests__/components/waves/drops/DropMinimalIdentityRow.test.tsx`:
- Around line 65-74: Replace the weak negative assertion on the tooltip subtree
with a global DOM absence check: in the test that renders DropMinimalIdentityRow
(the case using createDrop("human", "0xabc",
ApiProfileClassification.Pseudonym)), remove
expect(screen.getByTestId("tooltip-wrapper")).not.toHaveTextContent("🤖") and
instead assert expect(screen.queryByText("🤖")).not.toBeInTheDocument(); so the
test verifies the robot emoji is not present anywhere in the rendered output.
In `@__tests__/components/waves/drops/WaveDropHeader.test.tsx`:
- Around line 95-108: Replace the weak negative assertion in the "does not
render a robot emoji for non-AI profiles" test in WaveDropHeader.test.tsx:
instead of asserting the tooltip wrapper does not have text content "🤖" via
getByTestId("tooltip-wrapper"), use a global query for the emoji and assert it
is not present (expect(screen.queryByText("🤖")).not.toBeInTheDocument()),
matching the stronger pattern used in ProfileNameWithAiMarker.test.tsx; update
the assertion in the test for WaveDropHeader accordingly.
In `@components/common/profile/ProfileNameWithAiMarker.tsx`:
- Around line 15-24: ProfileNameWithAiMarker currently replaces
DEFAULT_CLASS_NAME when a caller supplies className which breaks layout; update
the component to merge DEFAULT_CLASS_NAME with the incoming className (e.g., via
clsx or a simple `${DEFAULT_CLASS_NAME} ${className}` composition) when building
the span's className, and similarly compose markerClassName with its default if
present; modify the return span in ProfileNameWithAiMarker to use the composed
class strings so callers can augment rather than replace the defaults (leave
ApiProfileClassification.Ai, children and other logic unchanged).
In `@components/waves/utils/getOptimisticDrop.ts`:
- Around line 93-94: getOptimisticDrop currently passes
connectedProfile.classification through directly which can be undefined; update
getOptimisticDrop to mirror buildPreviewDrop by importing
ApiProfileClassification and defaulting classification to
ApiProfileClassification.Pseudonym when connectedProfile.classification is
falsy, so the optimistic drop (and its ApiProfileMin shape used by components
like ProfileNameWithAiMarker) always has a valid classification value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9f6081c4-f817-4cc4-935e-77a7e755cb02
⛔ Files ignored due to path filters (7)
generated/models/ApiDropResolvedIdentityProfile.tsis excluded by!**/generated/**generated/models/ApiMemesMintStat.tsis excluded by!**/generated/**generated/models/ApiPaymentDetails.tsis excluded by!**/generated/**generated/models/ApiProfileMin.tsis excluded by!**/generated/**generated/models/ApiProfileWave.tsis excluded by!**/generated/**generated/models/ApiSetProfileWaveRequest.tsis excluded by!**/generated/**generated/models/ObjectSerializer.tsis excluded by!**/generated/**
📒 Files selected for processing (18)
__tests__/components/common/profile/ProfileNameWithAiMarker.test.tsx__tests__/components/user/user-page-header/name/UserPageHeaderName.test.tsx__tests__/components/waves/drop/SingleWaveDropAuthor.test.tsx__tests__/components/waves/drops/DropMinimalIdentityRow.test.tsx__tests__/components/waves/drops/WaveDropHeader.test.tsxcomponents/common/profile/ProfileNameWithAiMarker.tsxcomponents/manifold-minting/ManifoldMinting.tsxcomponents/user/user-page-header/name/UserPageHeaderName.tsxcomponents/waves/drop/SingleWaveDropAuthor.tsxcomponents/waves/drops/DropAuthorBadges.tsxcomponents/waves/drops/DropMinimalIdentityRow.tsxcomponents/waves/drops/WaveDropHeader.tsxcomponents/waves/drops/reaction-utils.tscomponents/waves/memes/submission/utils/buildPreviewDrop.tscomponents/waves/specs/groups/group/edit/WaveGroupChangeDialog.tsxcomponents/waves/utils/getOptimisticDrop.tshelpers/ProfileHelpers.tsopenapi.yaml
|



Summary by CodeRabbit
Release Notes
New Features
Tests